/**
 * $Revision: 1.0 $
 * $Author: Eric Yang $
 * $Date: Aug 24, 2009 11:25:49 PM $
 *
 * Author: Eric Yang
 * Date  : Aug 24, 2009 11:25:49 PM
 *
 */
package com.gooex.service.base;

import java.util.List;
import org.c4j.system.web.page.Page;

import com.gooex.domain.base.Category;
import com.gooex.domain.base.Product;
import com.gooex.domain.base.Property;
import com.gooex.domain.base.PropertyValue;
import com.gooex.domain.organization.User;
import com.gooex.service.base.exception.ProductException;

/**
 * @author Eric Yang
 * @version 1.0
 */
public interface IProductManager {
	/** TODO comment */
	public Product getProduct(String id);

	/**
	 * 如果id为空或找不到商品将抛出异常
	 */
	public Product loadProduct(String id);

	/** TODO comment */
	public Product getProductByName(String name);

	/** TODO comment */
	public void saveProduct(Product product);

	/** TODO comment */
	public void removeProduct(Product product) throws ProductException;

	/** TODO comment */
	public List<Product> getProducts();

	/** TODO comment */
	public List<Product> findProducts(List<PropertyValue> values);

	public List<Product> findProductsByName(String name, Page page);

	public List<Product> getProducts(User user);

	public List<Product> getProducts(User user, boolean raw);

	public List<Product> getTopNewProducts(int number);

	public void updateProperty(Product product, List<Property> properties);

	public void saveProperty(Product product, Property property);

	public List<Product> getProducts(String keyword, Page page);

	public List<Product> getProducts(String keyword, Page page, boolean raw);

	public List<Product> getProducts(Category category, Page page);

	public List<Product> getProducts(Category category, Page page, boolean raw);

	public List<Product> getProducts(Category category, String keyword, Page page);

	public List<Product> getProducts(Category category, String keyword, Page page, boolean raw);

	public List<Product> getProducts(Category category, User currentUser, boolean raw);

}
